public class Demo14 {
 public static void main(String[] args) throws InterruptedException {
    Thread t=new Thread(()->{
        while(true){
            //对于t来说就是TIMED_WAITING状态 有限制等待
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    });
    System.out.println(t.getState()+"isAlive="+t.isAlive());
    t.start();
    System.out.println(t.getState()+"isAlive="+t.isAlive());
    t.join();
    //对main来说就是WAITING状态 无限制等待
    System.out.println(t.getState()+"isAlive="+t.isAlive());
 }
}
